900
How do I get ride of the separator items when the user performs grouping

PROCEDURE OnAddGroupItem(oGrid,Item)
	oGrid:Items():SetProperty("ItemDividerLine",Item,0/*EmptyLine*/)
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AddGroupItem := {|Item| OnAddGroupItem(oGrid,Item)} /*Occurs after a new Group Item has been inserted to Items collection.*/

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(1):SortOrder := 1/*SortAscending*/
		oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
899
How do I split a cell in three parts, and having a radio button in each of them

PROCEDURE OnCellStateChanged(oGrid,Item,ColIndex)
	DevOut( oGrid:Items:CellCaption(Item,ColIndex) )
RETURN

PROCEDURE OnClick(oGrid)
	LOCAL h
	h := oGrid:ItemFromPoint(-1,-1,c,hit)
	oGrid:Items():SetProperty("CellState",h,c,1)
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oGrid,Item,ColIndex)} /*Fired after cell's state has been changed.*/
		oGrid:Click := {|| OnClick(oGrid)} /*Occurs when the user presses and then releases the left mouse button over the grid control.*/

		oGrid:BeginUpdate()
		oGrid:FullRowSelect := 0/*exColumnSel*/
		oGrid:SetProperty("SelBackColor",oGrid:BackColor())
		oGrid:SetProperty("SelForeColor",oGrid:ForeColor())
		oGrid:DrawGridLines := -1/*exAllLines*/
		oGrid:ShowFocusRect := .F.
		oGrid:Columns():Add("Default"):SetProperty("Def",17/*exCellValueFormat*/,1)
		oItems := oGrid:Items()
			h := oItems:AddItem("entire")
			h := oItems:AddItem("Radio <b>1")
			oItems:SetProperty("CellRadioGroup",h,0,100)
			oItems:SetProperty("CellHasRadioButton",h,0,.T.)
			oItems:SetProperty("CellState",h,0,1)
			h := oItems:SplitCell(h,0)
			oItems:SetProperty("CellValue",0,h,"Radio <b>2")
			oItems:SetProperty("CellRadioGroup",0,h,100)
			oItems:SetProperty("CellHasRadioButton",0,h,.T.)
			h := oItems:SplitCell(0,h)
			oItems:SetProperty("CellValue",0,h,"Radio <b>3")
			oItems:SetProperty("CellRadioGroup",0,h,100)
			oItems:SetProperty("CellHasRadioButton",0,h,.T.)
			h := oItems:AddItem("entire")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
898
Does your grid include a row indicator , like an arrow, bullet

PROCEDURE OnSelectionChanged(oGrid)
	LOCAL oItems
	LOCAL hFocusItem
	oItems := oGrid:Items()
		hFocusItem := oItems:FocusItem()
		oItems:SetProperty("CellValue",oGrid:Columns:Item("active"):Data(),"active","")
		oItems:SetProperty("CellValue",hFocusItem,"active","<c><font symbol>·")
		oItems:SetProperty("CellVAlignment",hFocusItem,"active",2/*exBottom*/)
		oGrid:Columns:Item("active"):Data := hFocusItem
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:SelectionChanged := {|| OnSelectionChanged(oGrid)} /*Fired after a new item has been selected.*/

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:ShowFocusRect := .F.
		oGrid:ContinueColumnScroll := .T.
		oGrid:ScrollBySingleLine := .T.
		oGrid:AutoDrag := 4112/*exAutoDragScrollOnShortTouch+exAutoDragScroll*/
		oColumn := oGrid:Columns():Add("")
			oColumn:Key := "active"
			oColumn:Position := 0
			oColumn:AllowSizing := .F.
			oColumn:Width := 12
			oColumn:Data := oGrid:Items():FocusItem()
			oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
		oGrid:CountLockedColumns := 1
		oItems := oGrid:Items()
			oItems:SetProperty("SelectItem",oItems:NextVisibleItem(oItems:FocusItem()),.T.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
897
How can I connect to a DBF file
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .F.
		oGrid:ContinueColumnScroll := .F.
		rs := CreateObject("ADODB.Recordset")
			rs:Open("Select * From foxcode.DBF","Provider=vfpoledb;Data Source=C:\Program Files\Microsoft Visual FoxPro 9\",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
896
Does your control supports scrolling by touching the screen

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:ContinueColumnScroll := .T.
		oGrid:ScrollBySingleLine := .T.
		oGrid:AutoDrag := 4112/*exAutoDragScrollOnShortTouch+exAutoDragScroll*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
895
How do I prevent showing the control's BackColorAlternate property on empty / non-items part of the control

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:SetProperty("BackColorAlternate",0x7ff0f0f0)
		oGrid:Columns():Add("Column")
		oItems := oGrid:Items()
			oItems:AddItem("Item 1")
			oItems:AddItem("Item 2")
			oItems:AddItem("Item 3")
			oItems:AddItem("Item 4")
			oItems:AddItem("Item 5")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
894
Is there any method for reading information from the root item for the current item...

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oGrid:SearchColumnIndex := 0
		oGrid:Columns():Add("Info")
		oItems := oGrid:Items()
			oItems:PathSeparator := " ; "
			oItems:SetProperty("SelectItem",oItems:InsertItem(oItems:InsertItem(oItems:InsertItem(oItems:InsertItem(,,"Root"),,"Child"),,"Sub-Child"),,"Sub-Sub-Child"),.T.)
			oItems:SetProperty("ExpandItem",0,.T.)
			DevOut( oItems:FullPath(oItems:FocusItem()) )
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
893
How can I highlight items with a specified date

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oColumns := oGrid:Columns()
			oColumns:Add("Tasks")
			oColumn := oColumns:Add("Date")
				oColumn:SortType := 2/*SortDate*/
				oColumn:Editor():EditType := 4/*SpinType*/
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem("Task 1"),1,"12/13/2001")
			oItems:SetProperty("CellValue",oItems:AddItem("Task 2"),1,"12/14/2001")
			oItems:SetProperty("CellValue",oItems:AddItem("Task 2"),1,"12/15/2001")
		oGrid:ConditionalFormats():Add("%1 = #12/14/2001#"):Bold := .T.
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
892
Today date is shown, if we use the Column.FormatColumn and Editor.Option(exDateAllowNullDate) properties. What can be done

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oColumn := oGrid:Columns():Add("Date")
			oColumn:FormatColumn := "len(value) ? ( (longdate(date(value)) left 3) + ' ' + day(date(value)) + '/' + month(date(value)) + '/' + (year(date(value)) right 2) ) : '' )"
			oEditor := oColumn:Editor()
				oEditor:EditType := 7/*DateType*/
				oEditor:SetProperty("Option",14/*exDateAllowNullDate*/,.T.)
		oItems := oGrid:Items()
			oItems:AddItem("05/12/2012")
			oItems:AddItem()
			oItems:AddItem("05/14/2012")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
891
How can I add multiple values/columns on the same line/item/row

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	oGrid:Refresh()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems
	LOCAL h,h1

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oGrid:BeginUpdate()
		oGrid:SortOnClick := 0/*exNoSort*/
		oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
		oGrid:Indent := 13
		oGrid:HeaderVisible := .F.
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumns := oGrid:Columns()
			oColumns:Add("Items")
			oColumns:Add("Quantity"):Editor():EditType := 4/*SpinType*/
			oColumns:Add("Value"):Editor():EditType := 4/*SpinType*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Items")
			oItems:SetProperty("CellValue",h,2,"sum(current,dir,dbl(%1)*dbl(%2))")
			oItems:SetProperty("CellValueFormat",h,2,4/*exTotalField*/)
			oItems:SetProperty("FormatCell",h,2,"`Total: `+ value")
			oItems:SetProperty("CellHAlignment",h,2,2/*RightAlignment*/)
			oItems:SetProperty("CellBold",h,2,.T.)
			oItems:SetProperty("CellEditorVisible",h,2,0/*exEditorHidden*/)
			oItems:SetProperty("CellEditorVisible",h,1,0/*exEditorHidden*/)
			h1 := oItems:InsertItem(h,,"Item 1")
			oItems:SetProperty("CellValue",h1,1,10)
			oItems:SetProperty("CellValue",h1,2,3)
			h1 := oItems:InsertItem(h,,"Item 2")
			oItems:SetProperty("CellValue",h1,1,20)
			oItems:SetProperty("CellValue",h1,2,4)
			oItems:SetProperty("ExpandItem",h,.T.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
890
Is there a syntax for conditional formatting of items, based on CellState/CellStateChange

PROCEDURE OnCellStateChanged(oGrid,Item,ColIndex)
	LOCAL oItems
	oItems := oGrid:Items()
		oItems:SetProperty("CellValue",Item,2,oItems:CellState(Item,0))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL var_ConditionalFormat
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oGrid,Item,ColIndex)} /*Fired after cell's state has been changed.*/

		oGrid:BeginUpdate()
		oGrid:ShowFocusRect := .F.
		oGrid:SelBackMode := 1/*exTransparent*/
		var_ConditionalFormat := oGrid:ConditionalFormats:Add("%2 != 0")
			var_ConditionalFormat:Bold := .T.
			var_ConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			var_ConditionalFormat:ApplyTo := -1/*exFormatToItems*/
		oColumn := oGrid:Columns():Add("")
			oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
			oColumn:Width := 16
			oColumn:AllowSizing := .F.
		oGrid:Columns():Add("Information")
		oGrid:Columns():Add("Hidden"):Visible := .F.
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem(""),1,"This is a bit of text associated")
			h := oItems:AddItem("")
			oItems:SetProperty("CellValue",h,1,"This is a bit of text associated")
			oItems:SetProperty("CellState",h,0,1)
			oItems:SetProperty("CellValue",oItems:AddItem(""),1,"This is a bit of text associated")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
889
How do I programatically focus a cell

PROCEDURE OnFocusChanged(oGrid)
	LOCAL oItems
	oItems := oGrid:Items()
		oItems:SetProperty("CellBackColor",oItems:FocusItem(),oGrid:FocusColumnIndex(),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems,oItems1

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:FocusChanged := {|| OnFocusChanged(oGrid)} /*Occurs when a new cell is focused.*/

		oGrid:BeginUpdate()
		oGrid:SetProperty("SelForeColor",oGrid:ForeColor())
		oGrid:SetProperty("SelBackColor",oGrid:BackColor())
		oGrid:DrawGridLines := -2/*exRowLines*/
		oColumns := oGrid:Columns()
			oColumns:Add("Column1")
			oColumns:Add("Column2")
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem("Cell 1.1"),1,"Cell 1.2")
			oItems:SetProperty("CellValue",oItems:AddItem("Cell 2.1"),1,"Cell 2.2")
		oItems1 := oGrid:Items()
			oItems1:SetProperty("SelectItem",oItems1:ItemByIndex(1),.T.)
		oGrid:FocusColumnIndex := 1
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
888
How do I programatically focus a cell (excrd)

PROCEDURE OnFocusChanged(oGrid)
	LOCAL oItems
	oItems := oGrid:Items()
		oItems:SetProperty("CellBackColor",oItems:FocusItem(),oGrid:FocusColumnIndex(),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oItems,oItems1
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:FocusChanged := {|| OnFocusChanged(oGrid)} /*Occurs when a new cell is focused.*/

		oGrid:BeginUpdate()
		oGrid:SetProperty("SelForeColor",oGrid:ForeColor())
		oGrid:SetProperty("SelBackColor",oGrid:BackColor())
		oGrid:DrawGridLines := -2/*exRowLines*/
		oGrid:DefaultItemHeight := 36
		oColumns := oGrid:Columns()
			oColumns:Add("Column1"):Visible := .F.
			oColumns:Add("Column2"):Visible := .F.
			oColumns:Add("Column3"):Visible := .F.
			oColumn := oColumns:Add("FormatLevel")
				oColumn:FormatLevel := "(0/1),2"
				oColumn:SetProperty("Def",32/*exCellFormatLevel*/,oColumn:FormatLevel())
		oItems := oGrid:Items()
			h := oItems:AddItem("Cell 1.1")
			oItems:SetProperty("CellValue",h,1,"Cell 1.2")
			oItems:SetProperty("CellValue",h,2,"Cell 1.3")
			h := oItems:AddItem("Cell 2.1")
			oItems:SetProperty("CellValue",h,1,"Cell 2.2")
			oItems:SetProperty("CellValue",h,2,"Cell 2.3")
		oItems1 := oGrid:Items()
			oItems1:SetProperty("SelectItem",oItems1:ItemByIndex(1),.T.)
		oGrid:FocusColumnIndex := 2
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
887
How do I programmatically exclude items from the filter

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumn := oGrid:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/
		oItems := oGrid:Items()
			oItems:AddItem("Item 1")
			oItems:AddItem("Item 2")
			oItems:AddItem("Item 3")
			oItems:AddItem("Item 4")
		oColumn1 := oGrid:Columns:Item(0)
			oColumn1:FilterType := 752/*exFilterExclude+exFilter*/
			oColumn1:Filter := "Item 1|Item 4"
		oGrid:ApplyFilter()
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
886
Using the property Column.FormatColumn I want to display numbers in the numeric format with no decimals - unless the value is NULL then I want to display a blank or empty

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oColumns := oGrid:Columns()
			oColumns:Add("Format"):FormatColumn := "len(value) ? (value format '0') : '' "
		oItems := oGrid:Items()
			oItems:AddItem(10)
			oItems:AddItem()
			oItems:AddItem(-8)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
885
How can I change the drop down filter background color

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oGrid:SetProperty("Background",26/*exBackColorFilter*/,AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
		oColumn := oGrid:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 1315/*exShowFocusItem+exShowCheckBox+exSortItemsAsc+exLeafItems*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:InsertItem(h,,"Child 3")
			oItems:SetProperty("ExpandItem",h,.T.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
884
I am using AllowGroupBy property and calling the Column.SortOrder property groups by that column. Is it possible to prevent that, so I have a similar behavior like I click the column's header rather than dragging it to the control's GroupBy bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oColumns := oGrid:Columns()
			oColumns:Add("First")
			oColumns:Add("Second")
			oColumns:Add("Third")
		oGrid:SortBarVisible := .T.
		oGrid:SingleSort := .F.
		oGrid:AllowGroupBy := .T.
		oGrid:Layout := "SingleSort = " + CHR(34) + "C0:1" + CHR(34) + ";MultipleSort = " + CHR(34) + "C1:2 C2:1" + CHR(34) + ""

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
883
Calling programatically the Column.SortOrder property adds the column to the sort bar. Is it possible to prevent that, so I have a similar behavior like I click the column's header rather than dragging it to the control's Sort bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oColumns := oGrid:Columns()
			oColumns:Add("First")
			oColumns:Add("Second")
			oColumns:Add("Third")
		oGrid:SortBarVisible := .T.
		oGrid:SingleSort := .F.
		oGrid:Layout := "SingleSort = " + CHR(34) + "C0:1" + CHR(34) + ""

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
882
How do I restore/clear the HotBackColor/HotForeColor properties

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:SetProperty("HotBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,255 } )  , .F. ))
		oGrid:SetProperty("HotForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
		oGrid:Columns():Add("Value"):Visible := .F.
		oColumn := oGrid:Columns():Add("USD")
			oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
			oColumn:FormatColumn := "len(%0) ? ((0:=dbl(%0)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + `USD `+ (=:0 format ``)"
		oColumn1 := oGrid:Columns():Add("EUR")
			oColumn1:SetProperty("Def",17/*exCellValueFormat*/,1)
			oColumn1:FormatColumn := "len(%0) ? ((0:=0.72*dbl(%0)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + `EUR `+ (=:0 format ``)"
		oItems := oGrid:Items()
			oItems:AddItem("1.23")
			oItems:AddItem("2.34")
			oItems:AddItem("9.94")
			oItems:AddItem("11.94")
			oItems:AddItem("1000")
		oGrid:SetProperty("HotBackColor",oGrid:BackColor())
		oGrid:SetProperty("HotForeColor",oGrid:ForeColor())
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
881
How do I format a column using a currency, and another column to another currency

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Columns():Add("Value"):Visible := .F.
		oColumn := oGrid:Columns():Add("USD")
			oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
			oColumn:FormatColumn := "len(%0) ? ((0:=dbl(%0)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + `USD `+ (=:0 format ``)"
		oColumn1 := oGrid:Columns():Add("EUR")
			oColumn1:SetProperty("Def",17/*exCellValueFormat*/,1)
			oColumn1:FormatColumn := "len(%0) ? ((0:=0.72*dbl(%0)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + `EUR `+ (=:0 format ``)"
		oItems := oGrid:Items()
			oItems:AddItem("1.23")
			oItems:AddItem("2.34")
			oItems:AddItem("9.94")
			oItems:AddItem("11.94")
			oItems:AddItem("1000")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
880
How can I sort the columns to be displayed on the columns floating bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .F.
		oColumns := oGrid:Columns()
			oColumns:Add("City"):Visible := .F.
			oColumns:Add("Start"):Visible := .F.
			oColumns:Add("End"):Visible := .F.
		oGrid:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/
		oGrid:ColumnsFloatBarSortOrder := 1/*SortAscending*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
879
How can I get the column index and the row index of the active cell

PROCEDURE OnFocusChanged(oGrid)
	LOCAL oItems
	DevOut( "Active/Focus-Column:" )
	DevOut( oGrid:Columns:Item(oGrid:FocusColumnIndex()):Caption() )
	oItems := oGrid:Items()
		DevOut( "Active/Focus-Row/Item:" )
		DevOut( oItems:CellCaption(oItems:FocusItem(),oGrid:FocusColumnIndex()) )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:FocusChanged := {|| OnFocusChanged(oGrid)} /*Occurs when a new cell is focused.*/

		oGrid:BeginUpdate()
		oColumns := oGrid:Columns()
			oColumns:Add("C1"):Editor():EditType := 1/*EditType*/
			oColumns:Add("C2"):Editor():EditType := 1/*EditType*/
			oColumns:Add("C3"):Editor():EditType := 1/*EditType*/
		oItems := oGrid:Items()
			h := oItems:AddItem(1)
			oItems:SetProperty("CellValue",h,1,2)
			oItems:SetProperty("CellValue",h,2,3)
			h := oItems:AddItem(3)
			oItems:SetProperty("CellValue",h,1,1)
			oItems:SetProperty("CellValue",h,2,2)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
878
How can I add a vertical padding

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:DrawGridLines := -1/*exAllLines*/
		oColumn := oGrid:Columns():Add("Padding")
			oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
			oColumn:SetProperty("Def",16/*exCellSingleLine*/,.F.)
			oColumn:SetProperty("Def",48/*exCellPaddingLeft*/,6)
			oColumn:SetProperty("Def",49/*exCellPaddingRight*/,6)
			oColumn:SetProperty("Def",50/*exCellPaddingTop*/,6)
			oColumn:SetProperty("Def",51/*exCellPaddingBottom*/,6)
		oItems := oGrid:Items()
			oItems:AddItem("padding")
			oItems:AddItem("padding")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
877
How can I set item's height individually for every item in the control and also have line breaks in the item caption

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:SetProperty("BackColorAlternate",AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oColumn := oGrid:Columns():Add("Lines")
			oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
			oColumn:SetProperty("Def",16/*exCellSingleLine*/,.F.)
		oGrid:ItemsAllowSizing := -1/*exResizeItem*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Line 1<br>Line 2")
			oItems:SetProperty("ItemMinHeight",h,36)
			oItems:SetProperty("ItemHeight",h,oItems:ItemMinHeight(h))
			oItems:SetProperty("ItemMaxHeight",h,oItems:ItemMinHeight(h))
			h := oItems:AddItem("Line 1<br>Line 2")
			oItems:SetProperty("ItemMinHeight",h,48)
			oItems:SetProperty("ItemHeight",h,oItems:ItemMinHeight(h))
			oItems:SetProperty("ItemMaxHeight",h,oItems:ItemMinHeight(h))
			h := oItems:AddItem("Line 1<br>Line 2")
			oItems:SetProperty("ItemMinHeight",h,64)
			oItems:SetProperty("ItemHeight",h,oItems:ItemMinHeight(h))
			oItems:SetProperty("ItemMaxHeight",h,oItems:ItemMinHeight(h))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
876
The mouse-cursor is shown over the tooltip. Is it possible somehow resolve this (method 2)

PROCEDURE OnMouseMove(oGrid,Button,Shift,X,Y)
	oGrid:ShowToolTip("This is bit of text that's shown when the user hovers the cell","Column",0,"+16","+16")
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oGrid,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/

		oGrid:Columns():Add("Column")
		oItems := oGrid:Items()
			oItems:AddItem("tooltip")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
875
The mouse-cursor is shown over the tooltip. Is it possible somehow resolve this (method 1)
PROCEDURE OnToolTip(oGrid,Item,ColIndex,Visible,X,Y,CX,CY)
	X := 0
	Y := 0
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ToolTip := {|Item,ColIndex,Visible,X,Y,CX,CY| OnToolTip(oGrid,Item,ColIndex,Visible,X,Y,CX,CY)} /*Fired when the control prepares the object's tooltip.*/

		oGrid:Columns():Add("Column")
		oItems := oGrid:Items()
			oItems:SetProperty("CellToolTip",oItems:AddItem("tooltip"),0,"This is bit of text that's shown when the user hovers the cell")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
874
How can I add a MIN or MAX field (for date)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:Columns():Add("Text"):SortType := 2/*SortDate*/
		oItems := oGrid:Items()
			oItems:AddItem("01/01/2001")
			oItems:AddItem("12/11/1998")
			oItems:AddItem("01/20/2014")
			oItems:AddItem("01/01/2013")
			h := oItems:AddItem("min(all,dir,date(%0))")
			oItems:SetProperty("SortableItem",h,.F.)
			oItems:SetProperty("CellValueFormat",h,0,4/*exTotalField*/)
			oItems:SetProperty("CellHAlignment",h,0,2/*RightAlignment*/)
			oItems:SetProperty("FormatCell",h,0,"'MIN: '+value")
			h := oItems:AddItem("max(all,dir,date(%0))")
			oItems:SetProperty("SortableItem",h,.F.)
			oItems:SetProperty("CellValueFormat",h,0,4/*exTotalField*/)
			oItems:SetProperty("CellHAlignment",h,0,2/*RightAlignment*/)
			oItems:SetProperty("FormatCell",h,0,"'MAX: '+value")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
873
How can I add a MIN or MAX field (for text)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:Columns():Add("Text"):SortType := 0/*SortString*/
		oItems := oGrid:Items()
			oItems:AddItem("aha")
			oItems:AddItem("baba")
			oItems:AddItem("aaha")
			oItems:AddItem("aka")
			h := oItems:AddItem("min(all,dir,str(%0))")
			oItems:SetProperty("SortableItem",h,.F.)
			oItems:SetProperty("CellValueFormat",h,0,4/*exTotalField*/)
			oItems:SetProperty("CellHAlignment",h,0,2/*RightAlignment*/)
			oItems:SetProperty("FormatCell",h,0,"'MIN: '+value")
			h := oItems:AddItem("max(all,dir,str(%0))")
			oItems:SetProperty("SortableItem",h,.F.)
			oItems:SetProperty("CellValueFormat",h,0,4/*exTotalField*/)
			oItems:SetProperty("CellHAlignment",h,0,2/*RightAlignment*/)
			oItems:SetProperty("FormatCell",h,0,"'MAX: '+value")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
872
How can I change the the focus rectangle

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABeEGACAADACAxRDgMQBQKAAzQFAYbBlBaERiGQYIJhUAIIRZGMQxXAcMQvDSKQJhGDAADENAxAJCI4DBIgZQNDwZQIkCY4ZDKHIfRzNAASJIkTQPBKfYDGOLhSh6IJGRpPEIxdJMBr+fZ9QApeoYVj2J4eUCAFBxDRsZw8BiNAbkOi4Jp1f5nVJaFSxCKoSxbNqSBpGCzoJrKdI0R5JES2BAddTLBKzX7tHArLgSJ5dSrLMrwSKcRR1HSbIDyGaMUiCSqGVjWNZ5FREM46AAGbDgMILEgOZpoYDFVTZTKFCS7I6Eb40CCbCyPJQAabgWo4KAAZThNi7QAua4bTr7HqibLAexaJDOc4HVSgMLlIYEkIeg2iybAjDkfhMFuHY7mQT4xB0TBnFoUQ6i+cg2j2SIvHqVZIl8cB+BwTgPA4NRdjycg2FoHhuAMUZuHGUAwCECQUAaEYMHQHRHCGFRZEQAABO2AwRFCWQJAoGxECW" +;
		"TBHkGBxpg8RhYBMbJbD+TBzByfwwAwCIOCWCQiGiJgogqYh4hYIQ/k2cx9gEYQAAiRgqgsYx4mYLIOiOCMjjCTA4iScw8mMOQWEaEZkGkDgpguUIYm4SITmUCQaDuExjgkRhWhQJQ0A4ToVmWSQWFkAAljkdhiheZgZgoXIZCUWYaF2GgihmKhrg4JRJjYboVmaSIiHOHQnAkahph2ZYJmQAAxAwSQKESHwkFkKgoiAIxIHoPIimOOg2DiCgoiQJRQTYQxwn8MgMgoMoPiaYoaGCfw4A4CJNAkOpcGQBCAg==")
		oGrid:SetProperty("Background",19/*exShowFocusRect*/,0x1000000)
		oColumn := oGrid:Columns():Add("Check")
			oColumn:SetProperty("Def",48/*exCellPaddingLeft*/,2)
			oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
		oGrid:SetProperty("SelForeColor",oGrid:ForeColor())
		oGrid:SetProperty("SelBackColor",oGrid:BackColor())
		oGrid:DefaultItemHeight := 22
		oGrid:ShowFocusRect := .T.
		oItems := oGrid:Items()
			oItems:AddItem("")
			oItems:AddItem("")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
871
Can each cell have their own dropdown lists that contain "different list item values" for each cell, not predefined for the entire column

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor,oEditor1,oEditor2,oEditor3
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oEditor := oGrid:Columns():Add("Column/Cell-Same"):Editor()
			oEditor:EditType := 3/*DropDownListType*/
			oEditor:AddItem(0,"Zero")
			oEditor:AddItem(1,"One")
			oEditor:AddItem(2,"Two")
		oEditor1 := oGrid:Columns():Add("Column/Cell-Different"):Editor()
			oEditor1:EditType := 1/*EditType*/
		oItems := oGrid:Items()
			oItems:AddItem()
			h := oItems:AddItem(0)
			oEditor2 := oItems:CellEditor(h,1)
				oEditor2:EditType := 3/*DropDownListType*/
				oEditor2:AddItem(3,"Three")
				oEditor2:AddItem(4,"Four")
			oItems:SetProperty("CellValue",h,1,3)
			oItems:AddItem()
			h := oItems:AddItem(0)
			oEditor3 := oItems:CellEditor(h,1)
				oEditor3:EditType := 6/*CheckListType*/
				oEditor3:AddItem(1,"Single")
				oEditor3:AddItem(2,"Double")
			oItems:SetProperty("CellValue",h,1,3)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
870
How can I specify just a few fonts in a FontType editor

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:DefaultItemHeight := 22
		oGrid:DrawGridLines := -2/*exRowLines*/
		oEditor := oGrid:Columns():Add("Fonts"):Editor()
			oEditor:EditType := 10/*FontType*/
			oEditor:ClearItems()
			oEditor:AddItem(0,"Calibri")
			oEditor:AddItem(1,"Arial")
			oEditor:AddItem(2,"Rockwell")
			oEditor:AddItem(3,"Tahoma")
			oEditor:SortItems(.T.)
			oEditor:DropDownRows := 4
		oItems := oGrid:Items()
			oItems:AddItem("Tahoma")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
869
How do you embed HTML options into the anchor click string

PROCEDURE OnAnchorClick(oGrid,AnchorID,Options)
	DevOut( Transform(AnchorID,"") )
	DevOut( Transform(Options,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AnchorClick := {|AnchorID,Options| OnAnchorClick(oGrid,AnchorID,Options)} /*Occurs when an anchor element is clicked.*/

		oGrid:BeginUpdate()
		oColumns := oGrid:Columns()
			oColumns:Add("Car"):SetProperty("Def",17/*exCellValueFormat*/,1)
		oItems := oGrid:Items()
			oItems:AddItem("<a mazda_1;options for 1>Mazda <b>1</b></a>")
			oItems:AddItem("<a mazda_2;options for 2>Mazda <b>2</b></a>")
			oItems:AddItem("<a mazda_3;options for 3a>Mazda <b>3.a</b></a>")
			oItems:AddItem("<a mazda_3;options for 3b>Mazda <b>3.b</b></a>")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
868
How do I add a checkbox column (method 2)

PROCEDURE OnCellStateChanged(oGrid,Item,ColIndex)
	DevOut( "CheckBox Changed:" )
	DevOut( Transform(oGrid:Items:CellState(Item,ColIndex),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oGrid,Item,ColIndex)} /*Fired after cell's state has been changed.*/

		oGrid:BeginUpdate()
		oGrid:Columns():Add("Check"):SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
		oItems := oGrid:Items()
			oItems:SetProperty("CellState",oItems:AddItem("Check 1"),0,0)
			oItems:SetProperty("CellState",oItems:AddItem("Check 2"),0,1)
			oItems:SetProperty("CellState",oItems:AddItem("Check 3"),0,0)
			oItems:SetProperty("CellState",oItems:AddItem("Check 4"),0,1)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
867
How do I add a checkbox column (method 1)

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	DevOut( "CheckBox Changed:" )
	DevOut( Transform(NewValue,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oGrid:BeginUpdate()
		oColumn := oGrid:Columns():Add("Check")
			oEditor := oColumn:Editor()
				oEditor:EditType := 19/*CheckValueType*/
				oEditor:SetProperty("Option",17/*exCheckValue2*/,1)
		oItems := oGrid:Items()
			oItems:AddItem(0)
			oItems:AddItem(1)
			oItems:AddItem(0)
			oItems:AddItem(1)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
866
How do I change the progress bar's appearance

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oAppearance
	LOCAL var_Editor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oAppearance := oGrid:VisualAppearance()
			oAppearance:Add(1,"c:\exontrol\images\normal.ebn")
			oAppearance:Add(2,"c:\exontrol\images\pushed.ebn")
		var_Editor := oGrid:Columns:Add("Progress"):Editor()
			var_Editor:EditType := 13/*ProgressBarType*/
			var_Editor:SetProperty("Option",11/*exProgressBarBackColor*/,16777216)
			var_Editor:SetProperty("Option",13/*exProgressBarMarkTicker*/,33554432)
		oGrid:Items():AddItem(33)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
865
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 3)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAEGg4BVEIQAAYAQGKIYBkAKBQAGaAoDDMOQwQwAAxjGKEEwsACEIrjKCRShyCYZRhGcTSBCIZBqEqSZLiEZRQCWIAzATGYBRfIUEgjBM6ExwG78egBHp/ZpkACIJJAaRjHQdJxGKKMQB9DIhCZpeKhWgkKIJBzOEyBRC4ERBGqNGrsIgLEqWZpnWhaNpWXYTLyBN64LhuK46g53O6wLxvK6hEr2dJ/YBcIAOfghf4NQ7EMRxLC8Mw3BDvYDkOAABAIgI=")
		oGrid:SetProperty("SelBackColor",0x1fffffe)
		oGrid:ShowFocusRect := .F.
		oGrid:Columns():Add("Items")
		oItems := oGrid:Items()
			oItems:SetProperty("ItemBackColor",oItems:AddItem("red"),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oItems:SetProperty("ItemBackColor",oItems:AddItem("blue"),AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,255 } )  , .F. ))
			oItems:SetProperty("ItemBackColor",oItems:AddItem("green"),AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
864
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:SelBackMode := 1/*exTransparent*/
		oGrid:ShowFocusRect := .F.
		oGrid:Columns():Add("Items")
		oItems := oGrid:Items()
			oItems:SetProperty("ItemBackColor",oItems:AddItem("red"),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oItems:SetProperty("ItemBackColor",oItems:AddItem("blue"),AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,255 } )  , .F. ))
			oItems:SetProperty("ItemBackColor",oItems:AddItem("green"),AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
863
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:SetProperty("SelBackColor",oGrid:BackColor())
		oGrid:SetProperty("SelForeColor",oGrid:ForeColor())
		oGrid:ShowFocusRect := .T.
		oGrid:Columns():Add("Items")
		oItems := oGrid:Items()
			oItems:SetProperty("ItemBackColor",oItems:AddItem("red"),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oItems:SetProperty("ItemBackColor",oItems:AddItem("blue"),AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,255 } )  , .F. ))
			oItems:SetProperty("ItemBackColor",oItems:AddItem("green"),AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
862
The BeforeExpandItem event is fired when clicking the drop down filter button. What we can do to prevent that

PROCEDURE OnBeforeExpandItem(oGrid,Item,Cancel)
	DevOut( "BeforeExpandItem" )
	DevOut( Transform(Item,"") )
	oGrid:Items():InsertItem(Item,,"new child")
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeforeExpandItem := {|Item,Cancel| OnBeforeExpandItem(oGrid,Item,Cancel)} /*Fired before an item is about to be expanded (collapsed).*/

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumns := oGrid:Columns()
			oColumn := oColumns:Add("Items")
				oColumn:DisplayFilterButton := .T.
				oColumn:FilterList := 4/*exRootItems*/
		oItems := oGrid:Items()
			oItems:SetProperty("ItemHasChildren",oItems:InsertItem(,,"Group 1"),.T.)
			oItems:SetProperty("ItemHasChildren",oItems:InsertItem(,,"Group 2"),.T.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
861
How can I change the shape of the line to be shown when user drag and drop data over the control, EBN

PROCEDURE OnOLEStartDrag(oGrid,Data,AllowedEffects)
	/*Data.SetData("data to be dragged")*/

RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:OLEStartDrag := {|Data,AllowedEffects| OnOLEStartDrag(oGrid,Data,AllowedEffects)} /*Occurs when the OLEDrag method is called.*/

		oGrid:OLEDropMode := 1/*exOLEDropManual*/
		oGrid:VisualAppearance():Add(1,"C:\Program Files\Exontrol\ExList\Sample\VB\DragDrop\insert_bottom.ebn")
		oGrid:SetProperty("Background",96/*exListOLEDropPosition*/,0x1000000)
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			oItems:AddItem("Item 1")
			oItems:AddItem("Item 2")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
860
How can I highlight the item from cursor when the user drag and drop data over the control

PROCEDURE OnOLEStartDrag(oGrid,Data,AllowedEffects)
	/*Data.SetData("data to be dragged")*/

RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:OLEStartDrag := {|Data,AllowedEffects| OnOLEStartDrag(oGrid,Data,AllowedEffects)} /*Occurs when the OLEDrag method is called.*/

		oGrid:OLEDropMode := 1/*exOLEDropManual*/
		oGrid:SetProperty("Background",96/*exListOLEDropPosition*/,AutomationTranslateColor( GraMakeRGBColor  ( { 1,0,0 } )  , .F. ))
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			oItems:AddItem("Item 1")
			oItems:AddItem("Item 2")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
859
Is it possible to always show the editor for all cells at all times

PROCEDURE OnAddItem(oGrid,Item)
	oGrid:Items():SetProperty("CellEditorVisible",Item,0,1/*exEditorVisible*/)
	oGrid:Items():SetProperty("CellEditorVisible",Item,1,1/*exEditorVisible*/)
RETURN

PROCEDURE OnEditOpen(oGrid)
	LOCAL oEditor
	LOCAL oItems
	LOCAL c,v
	oItems := oGrid:Items()
		v := oItems:CellValue(oItems:FocusItem(),0)
		c := oItems:CellCaption(oItems:FocusItem(),0)
	oEditor := oGrid:Columns:Item(1):Editor()
		oEditor:ClearItems()
		oEditor:AddItem(v,Transform(c,""))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oEditor
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AddItem := {|Item| OnAddItem(oGrid,Item)} /*Occurs after a new Item has been inserted to Items collection.*/
		oGrid:EditOpen := {|| OnEditOpen(oGrid)} /*Occurs when the edit operation starts.*/

		oGrid:BeginUpdate()
		oColumn := oGrid:Columns():Add("DropDownList")
			oEditor := oColumn:Editor()
				oEditor:EditType := 3/*DropDownListType*/
				oEditor:AddItem(1,"First")
				oEditor:AddItem(2,"Second")
				oEditor:AddItem(3,"Third")
		oGrid:DrawGridLines := -1/*exAllLines*/
		oGrid:Columns():Add("DropDownList-Related"):Editor():EditType := 3/*DropDownListType*/
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem(1),1,-1)
			oItems:SetProperty("CellValue",oItems:AddItem(2),1,-1)
			oItems:SetProperty("CellValue",oItems:AddItem(3),1,-1)
			oItems:SetProperty("LockedItemCount",2/*exBottom*/,1)
			h := oItems:LockedItem(2/*exBottom*/,0)
			oItems:SetProperty("ItemDivider",h,0)
			oItems:SetProperty("ItemDividerLineAlignment",h,2/*DividerTop*/)
			oItems:SetProperty("CellEditorVisible",h,0,0/*exEditorHidden*/)
			oItems:SetProperty("CellSingleLine",h,0,0/*exCaptionWordWrap*/)
			oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/)
			oItems:SetProperty("CellValue",h,0,"The drop down editor in the second column is filled during the <b>EditOpen event</b>, and the values are based on the selection on the first column.")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
858
How do I set a computated cell individually

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:Columns():Add("Number")
		oGrid:Columns():Add("Format")
		oItems := oGrid:Items()
			h := oItems:AddItem("1.23")
			oItems:SetProperty("CellValueFormat",h,1,3/*exComputedField+exHTML*/)
			oItems:SetProperty("CellValue",h,1,"2 * %0 + ` <font ;6><fgcolor=808080>(2 * Number)`")
			h := oItems:AddItem("1.23")
			oItems:SetProperty("CellValueFormat",h,1,3/*exComputedField+exHTML*/)
			oItems:SetProperty("CellValue",h,1,"3 * %0 + ` <font ;6><fgcolor=808080>(3 * Number)`")
			h := oItems:AddItem("1.23")
			oItems:SetProperty("CellValueFormat",h,1,3/*exComputedField+exHTML*/)
			oItems:SetProperty("CellValue",h,1,"currency(%0) + ` <font ;6><fgcolor=808080>( Currency(Number) )`")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
857
Is it possible to assign a different editor for some cells

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor,oEditor1,oEditor2
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("Column - DropDownList"):Editor()
			oEditor:EditType := 3/*DropDownListType*/
			oEditor:AddItem(1,"First item")
			oEditor:AddItem(2,"Second item")
			oEditor:AddItem(3,"Third item")
		oGrid:Columns():Add("Cell - DropDownList"):SetProperty("Def",17/*exCellValueFormat*/,1)
		oItems := oGrid:Items()
			h := oItems:AddItem(1)
			oEditor1 := oItems:CellEditor(h,1)
				oEditor1:EditType := 3/*DropDownListType*/
				oEditor1:AddItem(1,"<b>First</b> item")
				oEditor1:AddItem(2,"<b>Second</b> item")
				oEditor1:AddItem(3,"<b>Third</b> item")
				oEditor1:AddItem(4,"<b>Forth</b> item")
			oItems:SetProperty("CellValue",h,1,2)
			h := oItems:AddItem(2)
			oEditor2 := oItems:CellEditor(h,1)
				oEditor2:EditType := 3/*DropDownListType*/
				oEditor2:AddItem(1,"<b>Aka First</b> item")
				oEditor2:AddItem(2,"<b>Aka Second</b> item")
				oEditor2:AddItem(3,"<b>Aka Third</b> item")
				oEditor2:AddItem(4,"<b>Aka Forth</b> item")
			oItems:SetProperty("CellValue",h,1,2)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
856
Is it possible to define the keys of the drop down values to be strings rather than numeric values

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	DevOut( "NewValue is" )
	DevOut( Transform(NewValue,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor,oEditor1
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oEditor := oGrid:Columns():Add("DropDownList-String"):Editor()
			oEditor:EditType := 3/*DropDownListType*/
			oEditor:AddItem(1,"NYC|New York City")
			oEditor:AddItem(2,"CJN|Cluj Napoca")
		oEditor1 := oGrid:Columns():Add("DropDownList-Numeric"):Editor()
			oEditor1:EditType := 3/*DropDownListType*/
			oEditor1:AddItem(1,"New York City")
			oEditor1:AddItem(2,"Cluj Napoca")
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem("NYC"),1,2)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
855
The Change event gets me the today date. How can I find what user typed

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	DevOut( "NewValue:" )
	DevOut( Transform(NewValue,"") )
	DevOut( "EditingValue:" )
	DevOut( oGrid:EditingText() )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oGrid:BeginUpdate()
		oGrid:Columns():Add("Edit"):Editor():EditType := 7/*DateType*/
		oGrid:Items():AddItem("01/01/2001")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
854
I have an edit field, when going to edit mode, the rightmost part is shown. Is it possible to show the left part instead

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oColumn := oGrid:Columns():Add("Edit")
			oColumn:Width := 64
			oColumn:AllowSizing := .F.
			oEditor := oColumn:Editor()
				oEditor:EditType := 8/*MaskType*/
				oEditor:Mask := ";;;rich"
		oGrid:Columns():Add("Empty")
		oItems := oGrid:Items()
			oItems:AddItem("This is a bit ot long text")
			oItems:AddItem("")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
853
I have a drop down field, the control shows the rightmost part of the selected caption. Is it possible to show the left part

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1
	LOCAL oEditor,oEditor1,oEditor2,oEditor3
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oColumn := oGrid:Columns():Add("DropDown")
			oColumn:Width := 64
			oColumn:AllowSizing := .F.
			oEditor := oColumn:Editor()
				oEditor:DropDownAlignment := 32/*0x20+*/
				oEditor:EditType := 2/*DropDownType*/
				oEditor:AddItem(1,"First item. This is a bit ot long text")
				oEditor:AddItem(2,"Second item. This is a bit ot long text")
				oEditor:AddItem(3,"Third item. This is a bit ot long text")
				oEditor:Mask := ";;;rich"
		oColumn1 := oGrid:Columns():Add("PickEdit")
			oColumn1:Width := 64
			oColumn1:AllowSizing := .F.
			oEditor1 := oColumn1:Editor()
				oEditor1:DropDownAlignment := 32/*0x20+*/
				oEditor1:EditType := 14/*PickEditType*/
				oEditor1:AddItem(1,"First item. This is a bit ot long text")
				oEditor1:AddItem(2,"Second item. This is a bit ot long text")
				oEditor1:AddItem(3,"Third item. This is a bit ot long text")
				oEditor1:Mask := ";;;rich"
		oGrid:Columns():Add("Empty")
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem("First item. This is a bit ot long text"),1,"Second item. This is a bit ot long text")
			h := oItems:AddItem("First item. This is a bit ot long text")
			oEditor2 := oItems:CellEditor(h,0)
				oEditor2:DropDownAlignment := 32/*0x20+*/
				oEditor2:EditType := 2/*DropDownType*/
				oEditor2:AddItem(1,"First item. This is a bit ot long text")
				oEditor2:AddItem(2,"Second item. This is a bit ot long text")
				oEditor2:AddItem(3,"Third item. This is a bit ot long text")
			oItems:SetProperty("CellValue",h,1,"Second item. This is a bit ot long text")
			oEditor3 := oItems:CellEditor(h,1)
				oEditor3:DropDownAlignment := 32/*0x20+*/
				oEditor3:EditType := 14/*PickEditType*/
				oEditor3:AddItem(1,"First item. This is a bit ot long text")
				oEditor3:AddItem(2,"Second item. This is a bit ot long text")
				oEditor3:AddItem(3,"Third item. This is a bit ot long text")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
852
Is there a property for the back color of the dropdown field

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oEditor := oGrid:Columns():Add("Date"):Editor()
			oEditor:EditType := 7/*DateType*/
			oEditor:SetProperty("Option",55/*exDropDownBackColor*/,15790320)
			oEditor:SetProperty("Option",56/*exDropDownForeColor*/,65793)
		oGrid:Items():AddItem("01/01/2001")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
851
Is it possible to change a back color of the field/cell when it takes a focus

PROCEDURE OnEditClose(oGrid)
	LOCAL oItems
	oItems := oGrid:Items()
		oItems:ClearCellBackColor(oItems:FocusItem(),oGrid:FocusColumnIndex())
RETURN

PROCEDURE OnEditOpen(oGrid)
	LOCAL oItems,oItems1
	oItems := oGrid:Items()
		oItems:SetProperty("CellBackColor",oItems:FocusItem(),oGrid:FocusColumnIndex(),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
	oItems1 := oGrid:Items()
		oItems1:SetProperty("CellValue",oItems1:FocusItem(),oGrid:FocusColumnIndex(),oGrid:Items():CellValue(oGrid:Items():FocusItem(),oGrid:FocusColumnIndex()))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:EditClose := {|| OnEditClose(oGrid)} /*Occurs when the edit operation ends.*/
		oGrid:EditOpen := {|| OnEditOpen(oGrid)} /*Occurs when the edit operation starts.*/

		oGrid:FullRowSelect := 0/*exColumnSel*/
		oGrid:Columns():Add("C1"):Editor():EditType := 1/*EditType*/
		oGrid:Columns():Add("C2"):Editor():EditType := 1/*EditType*/
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem("v1"),1,"v2")
			oItems:SetProperty("CellValue",oItems:AddItem("v3"),1,"v4")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
850
How can I display the current date mask, but still allow empty values

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:CauseValidateValue := -1/*exValidateCell*/
		oGrid:FullRowSelect := 0/*exColumnSel*/
		oGrid:DrawGridLines := -2/*exRowLines*/
		oEditor := oGrid:Columns():Add("Date"):Editor()
			oEditor:EditType := 7/*DateType*/
			oEditor:Mask := "!99/99/9999;1;;empty=1,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,overtype"
		oItems := oGrid:Items()
			oItems:AddItem()
			oItems:AddItem("01/01/2001")
			oItems:AddItem()
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
849
How can I align the days in a DateType editor

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor,oEditor1,oEditor2,oEditor3,oEditor4,oEditor5
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Columns():Add("DropDown")
		oItems := oGrid:Items()
			oEditor := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
				oEditor:EditType := 7/*DateType*/
				oEditor:DropDownAlignment := 2/*RightAlignment*/
			oEditor1 := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
				oEditor1:EditType := 7/*DateType*/
				oEditor1:DropDownAlignment := 1/*CenterAlignment*/
			oEditor2 := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
				oEditor2:EditType := 7/*DateType*/
				oEditor2:DropDownAlignment := 0/*LeftAlignment*/
			oEditor3 := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
				oEditor3:EditType := 7/*DateType*/
				oEditor3:DropDownAlignment := 32/*0x20+*/
			oEditor4 := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
				oEditor4:EditType := 7/*DateType*/
				oEditor4:DropDownAlignment := 33/*0x20+CenterAlignment*/
			oEditor5 := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
				oEditor5:EditType := 7/*DateType*/
				oEditor5:DropDownAlignment := 34/*0x20+RightAlignment*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
848
How can I align the drop down portion rather the inside captions

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor,oEditor1
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Columns():Add("DropDown"):Editor():EditType := 7/*DateType*/
		oItems := oGrid:Items()
			oEditor := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
				oEditor:EditType := 7/*DateType*/
				oEditor:DropDownAlignment := 32/*0x20+*/
			oEditor1 := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
				oEditor1:EditType := 7/*DateType*/
				oEditor1:DropDownAlignment := 16/*0x10+*/
			oItems:AddItem("01/01/2001")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
847
Is it possible to show a message that the field is empty

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oEditor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:DrawGridLines := -2/*exRowLines*/
		oGrid:FullRowSelect := 0/*exColumnSel*/
		oColumn := oGrid:Columns():Add("Float")
			oEditor := oColumn:Editor()
				oEditor:EditType := 8/*MaskType*/
				oEditor:Mask := ";;;float,digits=0,grouping=,invalid=empty,warning=invalid character"
		oGrid:Items():AddItem(192278)
		oGrid:Items():AddItem(1000)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
846
How can I mask a date

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor,oEditor1,oEditor2,oEditor3,oEditor4,oEditor5,oEditor6,oEditor7,oEditor8
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:CauseValidateValue := -1/*exValidateCell*/
		oGrid:FullRowSelect := 0/*exColumnSel*/
		oGrid:DrawGridLines := -2/*exRowLines*/
		oGrid:Columns():Add("Date")
		oGrid:Columns():Add("Mask")
		oItems := oGrid:Items()
			h := oItems:AddItem("01/01/2001")
			oEditor := oItems:CellEditor(h,0)
				oEditor:EditType := 7/*DateType*/
				oEditor:Mask := "{1,12}/{1,31}/{1950,2050};1;;select=1,warning=Invalid character!,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,validateas=1"
			oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
			h := oItems:AddItem("01/01/2001")
			oEditor1 := oItems:CellEditor(h,0)
				oEditor1:EditType := 7/*DateType*/
				oEditor1:Mask := "!99/99/9999;1;;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,overtype"
			oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
			h := oItems:AddItem("01/01/2001")
			oEditor2 := oItems:CellEditor(h,0)
				oEditor2:EditType := 7/*DateType*/
				oEditor2:Mask := "!99/99/9999;;;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,overtype"
			oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
			h := oItems:AddItem("01/01/2001")
			oEditor3 := oItems:CellEditor(h,0)
				oEditor3:EditType := 7/*DateType*/
				oEditor3:Mask := "!99/99/9999;; ;select=4,overtype,empty,warning=Invalid character!,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,validateas=1"
			oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
			h := oItems:AddItem("01/01/2001")
			oEditor4 := oItems:CellEditor(h,0)
				oEditor4:EditType := 7/*DateType*/
				oEditor4:Mask := "![0-9 ][0-9 ]/[0-9 ][0-9 ]/[0-9 ][0-9 ][0-9 ][0-9 ];1;;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,leading= "
			oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
			h := oItems:AddItem("01/01/2001")
			oItems:SetProperty("FormatCell",h,0,"len(value) ? shortdateF(value) : ``")
			oEditor5 := oItems:CellEditor(h,0)
				oEditor5:EditType := 7/*DateType*/
				oEditor5:Mask := "!99/99/9999;1;;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,overtype,leading"
			oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
			h := oItems:AddItem("01/01/2001")
			oItems:SetProperty("FormatCell",h,0,"len(value) ? shortdateF(value) : ``")
			oEditor6 := oItems:CellEditor(h,0)
				oEditor6:EditType := 7/*DateType*/
				oEditor6:Mask := "!00/00/0000;1;;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,overtype,leading"
			oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
			h := oItems:AddItem("01/01/2001")
			oItems:SetProperty("FormatCell",h,0,"len(value) ? shortdateF(value) : ``")
			oEditor7 := oItems:CellEditor(h,0)
				oEditor7:EditType := 7/*DateType*/
				oEditor7:Mask := "!00/00/0000;;0;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,overtype"
			oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
			h := oItems:AddItem("01/01/2001")
			oItems:SetProperty("FormatCell",h,0,"len(value) ? shortdateF(value) : ``")
			oEditor8 := oItems:CellEditor(h,0)
				oEditor8:EditType := 7/*DateType*/
				oEditor8:Mask := "!00/00/0000;;;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=1,overtype"
			oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
845
How can I display and edit an integer number to show grouping digits too ( no decimals)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oEditor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oColumn := oGrid:Columns():Add("Float")
			oColumn:FormatColumn := "value format `0`"
			oEditor := oColumn:Editor()
				oEditor:EditType := 8/*MaskType*/
				oEditor:Mask := ";;;float,digits=0"
		oGrid:Items():AddItem(192278)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
844
How can I display and edit a float number to show grouping digits too

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oEditor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oColumn := oGrid:Columns():Add("Float")
			oColumn:FormatColumn := "value format ``"
			oEditor := oColumn:Editor()
				oEditor:EditType := 8/*MaskType*/
				oEditor:Mask := ";;;float"
		oGrid:Items():AddItem(192278)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
843
How can I mask a phone number

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor,oEditor1,oEditor2,oEditor3
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:CauseValidateValue := -1/*exValidateCell*/
		oGrid:DrawGridLines := -2/*exRowLines*/
		oGrid:FullRowSelect := 0/*exColumnSel*/
		oGrid:Columns():Add("Phone"):Editor():EditType := 8/*MaskType*/
		oItems := oGrid:Items()
			h := oItems:AddItem()
			oEditor := oItems:CellEditor(h,0)
				oEditor:EditType := 8/*MaskType*/
				oEditor:Mask := "!(999) 000 0000;1;;select=1,empty,overtype,warning=invalid characer,invalid=The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field."
			h := oItems:AddItem("0123")
			oEditor1 := oItems:CellEditor(h,0)
				oEditor1:EditType := 8/*MaskType*/
				oEditor1:Mask := "!(999) 000 0000;2;;select=4"
			h := oItems:AddItem("0123")
			oEditor2 := oItems:CellEditor(h,0)
				oEditor2:EditType := 8/*MaskType*/
				oEditor2:Mask := "`Phone: `!(999) 000-0000"
			h := oItems:AddItem("(074) 876-1222")
			oEditor3 := oItems:CellEditor(h,0)
				oEditor3:EditType := 8/*MaskType*/
				oEditor3:Mask := "!(999) 000-0000;0"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
842
Is it possible to display the ColorType fields using RGB format

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor,oEditor1,oEditor2,oEditor3,oEditor4,oEditor5,oEditor6
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Columns():Add("Color"):Editor():EditType := 9/*ColorType*/
		oItems := oGrid:Items()
			oItems:AddItem(255)
			h := oItems:AddItem(255)
			oEditor := oItems:CellEditor(h,0)
				oEditor:EditType := 9/*ColorType*/
				oEditor:Mask := "`RGB(`{0,255}\,{0,255}\,{0,255}`)`;;0"
			h := oItems:AddItem(255)
			oEditor1 := oItems:CellEditor(h,0)
				oEditor1:EditType := 9/*ColorType*/
				oEditor1:Mask := "`&H`XXXXXXXX`&`;;0;overtype,insertype,warning=Wrong!"
			h := oItems:AddItem(255)
			oEditor2 := oItems:CellEditor(h,0)
				oEditor2:EditType := 9/*ColorType*/
				oEditor2:Mask := "`0x`XX `0x`XX `0x`XX;;0;overtype,insertype,warning=Wrong!"
			h := oItems:AddItem(255)
			oEditor3 := oItems:CellEditor(h,0)
				oEditor3:EditType := 9/*ColorType*/
				oEditor3:Mask := "R{0,255} G{0,255} B{0,255};;0;overtype,insertype,warning=Wrong!"
			h := oItems:AddItem(255)
			oEditor4 := oItems:CellEditor(h,0)
				oEditor4:EditType := 9/*ColorType*/
				oEditor4:Mask := "`(hexa) RGB 0x`XXXXXX;;0;overtype,insertype,warning=Wrong!"
			h := oItems:AddItem(255)
			oEditor5 := oItems:CellEditor(h,0)
				oEditor5:EditType := 9/*ColorType*/
				oEditor5:Mask := "`(decimal) Red: `{0,255}` Green: `{0,255}` Blue: `{0,255};;0;overtype,insertype,warning=Wrong!"
			h := oItems:AddItem(255)
			oEditor6 := oItems:CellEditor(h,0)
				oEditor6:EditType := 9/*ColorType*/
				oEditor6:Mask := "`(combine) Red: `{0,255}` Green: 0x`XX` Blue: `{0,255};;0;overtype,insertype,warning=Wrong!"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
841
How can I add the ExComboBox as an user editor

PROCEDURE OnUserEditorClose(oGrid,Object,Item,ColIndex)
	/*Items.CellValue(Item,ColIndex) = Object.Value*/

RETURN

PROCEDURE OnUserEditorOleEvent(oGrid,Object,Ev,CloseEditor,Item,ColIndex)
	DevOut( Transform(Ev,"") )
RETURN

PROCEDURE OnUserEditorOpen(oGrid,Object,Item,ColIndex)
	/*Object.Value = Me.Items.CellValue(Item,ColIndex)*/

RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oComboBox
	LOCAL oEditor
	LOCAL oItems
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:UserEditorClose := {|Object,Item,ColIndex| OnUserEditorClose(oGrid,Object,Item,ColIndex)} /*Fired the user editor is about to be opened.*/
		oGrid:UserEditorOleEvent := {|Object,Ev,CloseEditor,Item,ColIndex| OnUserEditorOleEvent(oGrid,Object,Ev,CloseEditor,Item,ColIndex)} /*Occurs when an user editor fires an event.*/
		oGrid:UserEditorOpen := {|Object,Item,ColIndex| OnUserEditorOpen(oGrid,Object,Item,ColIndex)} /*Occurs when an user editor is about to be opened.*/

		oGrid:BeginUpdate()
		oEditor := oGrid:Columns():Add("Exontrol.ComboBox"):Editor()
			oEditor:EditType := 16/*UserEditorType*/
			oEditor:UserEditor("Exontrol.ComboBox","")
			oComboBox := oEditor:UserEditorObject()
				oComboBox:BeginUpdate()
				oComboBox:Style := 2/*DropDownList*/
				oComboBox:ColumnAutoResize := .F.
				rs := CreateObject("ADOR.Recordset")
					rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
				oComboBox:DataSource := rs
				oComboBox:MinHeightList := 128
				oComboBox:SearchColumnIndex := 0
				oComboBox:UseTabKey := .F.
				oComboBox:EndUpdate()
		oGrid:DrawGridLines := -2/*exRowLines*/
		oGrid:DefaultItemHeight := 21
		oItems := oGrid:Items()
			oItems:SetProperty("CellEditorVisible",oItems:AddItem(10248),0,1/*exEditorVisible*/)
			oItems:SetProperty("CellEditorVisible",oItems:AddItem(10249),0,1/*exEditorVisible*/)
			oItems:SetProperty("CellEditorVisible",oItems:AddItem(10250),0,1/*exEditorVisible*/)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
840
How can I add a header row

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ShowLockedItems := .T.
		oGrid:DrawGridLines := 2/*exVLines*/
		oGrid:Columns():Add("C1")
		oGrid:Columns():Add("C2")
		oItems := oGrid:Items()
			oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
			h := oItems:LockedItem(0/*exTop*/,0)
			oItems:SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
			oItems:SetProperty("ItemForeColor",h,AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
			oItems:SetProperty("CellValue",h,0,"footer c1")
			oItems:SetProperty("CellValue",h,1,"footer c2")
			oItems:SetProperty("CellValue",oItems:AddItem("cell"),1,"cell")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
839
How can I add a footer row

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ShowLockedItems := .T.
		oGrid:DrawGridLines := 2/*exVLines*/
		oGrid:Columns():Add("C1")
		oGrid:Columns():Add("C2")
		oItems := oGrid:Items()
			oItems:SetProperty("LockedItemCount",2/*exBottom*/,1)
			h := oItems:LockedItem(2/*exBottom*/,0)
			oItems:SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
			oItems:SetProperty("ItemForeColor",h,AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
			oItems:SetProperty("CellValue",h,0,"footer c1")
			oItems:SetProperty("CellValue",h,1,"footer c2")
			oItems:SetProperty("CellValue",oItems:AddItem("cell"),1,"cell")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
838
How can I programmatically add more columns to the sort bar and other to be sorted, but not included in the sort bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:SortBarVisible := .T.
		oColumns := oGrid:Columns()
			oColumns:Add(Transform(0,""))
			oColumns:Add(Transform(1,""))
			oColumns:Add(Transform(2,""))
			oColumns:Add(Transform(3,""))
			oColumns:Add(Transform(4,""))
		oGrid:Layout := "multiplesort=" + CHR(34) + "C3:1 C4:2" + CHR(34) + ";singlesort=" + CHR(34) + "C2:1" + CHR(34) + ""

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
837
How can I fix a column, while other sizable and fill the control's client

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .T.
		oGrid:Columns():Add("Sizable")
		oColumn := oGrid:Columns():Add("F")
			oColumn:AllowSizing := .F.
			oColumn:Width := 16

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
836
Is it possible to use empty values on a PickEditType editor (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("DropDown"):Editor()
			oEditor:EditType := 14/*PickEditType*/
			oEditor:AddItem(0,"")
			oEditor:AddItem(1,"The first item")
			oEditor:AddItem(2,"The second item")
			oEditor:AddItem(3,"The third item")
		oItems := oGrid:Items()
			oItems:AddItem("The first item")
			oItems:AddItem("")
			oItems:AddItem("The third item")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
835
Is it possible to use empty values on a PickEditType editor (method 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("DropDown"):Editor()
			oEditor:EditType := 14/*PickEditType*/
			oEditor:SetProperty("Option",54/*exPickAllowEmpty*/,.T.)
			oEditor:AddItem(1,"The first item")
			oEditor:AddItem(2,"The second item")
			oEditor:AddItem(3,"The third item")
		oItems := oGrid:Items()
			oItems:AddItem("The first item")
			oItems:AddItem("")
			oItems:AddItem("The third item")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
834
How can I specify an unselectable cell

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oColumns := oGrid:Columns()
			oColumns:Add("C1")
			oColumns:Add("C2")
			oColumns:Add("C3")
		oItems := oGrid:Items()
			h := oItems:AddItem("unselectable item")
			oItems:SetProperty("CellValue",h,1,"unselectable item")
			oItems:SetProperty("CellValue",h,2,"unselectable item")
			oItems:SetProperty("SelectableItem",h,.F.)
			h := oItems:AddItem("selectable cell")
			oItems:SetProperty("CellValue",h,1,"unselectable cell")
			oItems:SetProperty("CellEnabled",h,1,.F.)
			oItems:SetProperty("CellForeColor",h,1,AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,0 } )  , .F. ))
			oItems:SetProperty("CellValue",h,2,"disabled cell")
			oItems:SetProperty("CellEnabled",h,2,.F.)
			h := oItems:AddItem("disabled item")
			oItems:SetProperty("CellValue",h,1,"disabled item")
			oItems:SetProperty("CellValue",h,2,"disabled item")
			oItems:SetProperty("EnableItem",h,.F.)
			oItems:SetProperty("SelectableItem",h,.F.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
833
Is it possible to edit a float number without using of e/E/d/D (exponent) and +/- (signs) characters

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("Edit"):Editor()
			oEditor:EditType := 1/*EditType*/
			oEditor:Numeric := 770/*exDisableSigns+exFloatInteger*/
		oGrid:Items():AddItem(1.22)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
832
How can I edit a float number with no using of e/E/d/D and + character

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("Edit"):Editor()
			oEditor:EditType := 1/*EditType*/
			oEditor:Numeric := 258/*exDisablePlus+exFloatInteger*/
		oGrid:Items():AddItem(1.22)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
831
Is it possible to edit a float number with no using of e/E/d/D (exponent) characters

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("Edit"):Editor()
			oEditor:EditType := 1/*EditType*/
			oEditor:Numeric := 2/*exFloatInteger*/
		oGrid:Items():AddItem(1.22)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
830
How can I edit an integer with no using of +/- signs

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("Edit"):Editor()
			oEditor:EditType := 1/*EditType*/
			oEditor:Numeric := 1023/*0xfc+exDisableSigns+exFloatInteger+exFloat*/
		oGrid:Items():AddItem(1)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
829
When I'm trying to show string with "line break" character (vbCrLF) in a textbox, it shows 2 squares. Is there any way to hide these squares

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1,oColumn2
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oColumns := oGrid:Columns()
			oColumns:Add("Value")
			oColumn := oColumns:Add("CellSingleLine = False")
				oColumn:ComputedField := "%0"
				oColumn:SetProperty("Def",16/*exCellSingleLine*/,.F.)
			oColumn1 := oColumns:Add("FormatColumn/replace CRLF")
				oColumn1:ComputedField := "%0"
				oColumn1:FormatColumn := "value replace `\r\n` with ``"
			oColumn2 := oColumns:Add("FormatColumn/replace TAB,CRLF")
				oColumn2:ComputedField := "%0"
				oColumn2:FormatColumn := "(value replace `\t` with ``) replace `\r\n` with ``"
		oItems := oGrid:Items()
			oItems:AddItem("a\ta\r\nb\tb")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
828
Is there any way to "unselect" radio group

PROCEDURE OnDblClick(oGrid,Shift,X,Y)
	LOCAL oItems
	LOCAL h
	oItems := oGrid:Items()
		h := oItems:CellChecked(1234)
		oItems:SetProperty("CellHasCheckBox",0,h,.T.)
		oItems:SetProperty("CellState",0,h,0)
		oItems:SetProperty("CellHasCheckBox",0,h,.F.)
RETURN

PROCEDURE OnSelectionChanged(oGrid)
	LOCAL oItems
	oItems := oGrid:Items()
		oItems:SetProperty("CellState",oItems:FocusItem(),0,1)
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:DblClick := {|Shift,X,Y| OnDblClick(oGrid,Shift,X,Y)} /*Occurs when the user dblclk the left mouse button over an object.*/
		oGrid:SelectionChanged := {|| OnSelectionChanged(oGrid)} /*Fired after a new item has been selected.*/

		oGrid:MarkSearchColumn := .F.
		oGrid:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,128 } )  , .F. ))
		oGrid:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,0 } )  , .F. ))
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			h := oItems:AddItem("Radio 1")
			oItems:SetProperty("CellHasRadioButton",h,0,.T.)
			oItems:SetProperty("CellRadioGroup",h,0,1234)
			h := oItems:AddItem("Radio 2")
			oItems:SetProperty("CellHasRadioButton",h,0,.T.)
			oItems:SetProperty("CellRadioGroup",h,0,1234)
			oItems:SetProperty("CellState",h,0,1)
			h := oItems:AddItem("Radio 3")
			oItems:SetProperty("CellHasRadioButton",h,0,.T.)
			oItems:SetProperty("CellRadioGroup",h,0,1234)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
827
The Column.Alignment property does not seem to work for cells with images in them. What can be done

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
		oGrid:TreeColumnIndex := -1
		oGrid:DrawGridLines := -1/*exAllLines*/
		oGrid:HeaderHeight := 24
		oGrid:DefaultItemHeight := 24
		oColumn := oGrid:Columns():Add("Image")
			oColumn:AllowSizing := .F.
			oColumn:Width := 32
			oColumn:HTMLCaption := "<img>1</img>"
			oColumn:HeaderAlignment := 1/*CenterAlignment*/
			oColumn:Alignment := 1/*CenterAlignment*/
			oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
		oGrid:Columns():Add("Rest")
		oItems := oGrid:Items()
			oItems:AddItem("<img>1</img>")
			oItems:AddItem("<img>2</img>")
			oItems:AddItem("<img>3</img>")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
826
Can I change the format of date to be shown in the control

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1,oColumn2
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oColumns := oGrid:Columns()
			oColumns:Add("Default")
			oColumn := oColumns:Add("Format.1")
				oColumn:ComputedField := "%0"
				oColumn:FormatColumn := "dateF(value) replace `/` with `-`"
			oColumn1 := oColumns:Add("Format.2")
				oColumn1:ComputedField := "%0"
				oColumn1:SetProperty("Def",17/*exCellValueFormat*/,1)
				oColumn1:FormatColumn := "`<b>`+ shortdate(value) + `</b> ` + timeF(value)"
			oColumn2 := oColumns:Add("Format.3")
				oColumn2:ComputedField := "%0"
				oColumn2:SetProperty("Def",17/*exCellValueFormat*/,1)
				oColumn2:FormatColumn := "( dateF(value) replace `/` with `-` ) + ` <b>`+ ( weekday(value) case ( 0 : `Su`; 1 : `Mo`; 2 : `Tu`; 3 : `We`; 4 : `Th`; 5 : `Fr`; 6 : `Sa`) )"
		oItems := oGrid:Items()
			oItems:AddItem("01/01/2001 10:00:00")
			oItems:AddItem("01/02/2001 10:00:00")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
825
How do I arrange my columns on multiple levels

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1,oColumn2
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		oGrid:DrawGridLines := -1/*exAllLines*/
		oColumns := oGrid:Columns()
			oColumn := oColumns:Add("C0")
				oColumn:ExpandColumns := "1,2"
				oColumn:DisplayExpandButton := .F.
			oColumns:Add("C1")
			oColumns:Add("C2")
			oColumns:Add("C3")
			oColumn1 := oColumns:Add("C4")
				oColumn1:ExpandColumns := "5,6"
				oColumn1:DisplayExpandButton := .F.
			oColumns:Add("C5")
			oColumn2 := oColumns:Add("C6")
				oColumn2:ExpandColumns := "6,7"
				oColumn2:DisplayExpandButton := .F.
			oColumns:Add("C7")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
824
Does your control support expandable header or columns, so I can arrange it on multiple levels

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:DrawGridLines := -1/*exAllLines*/
		oGrid:SetProperty("BackColorLevelHeader",AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oColumns := oGrid:Columns()
			oColumn := oColumns:Add("Photo")
				oColumn:AllowSizing := .F.
				oColumn:Width := 32
			oColumns:Add("Personal Info")
			oColumns:Add("Title")
			oColumns:Add("Name")
			oColumns:Add("First")
			oColumns:Add("Last")
			oColumns:Add("Address")
			oColumns:Item("Personal Info"):ExpandColumns := "2,3"
			oColumn1 := oColumns:Item("Name")
				oColumn1:ExpandColumns := "4,5"
				oColumn1:Expanded := .F.
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
823
How can I use the MinWidthAutoResize/MaxWidthAutoResize

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oColumn := oGrid:Columns:Item(0)
			oColumn:MaxWidthAutoResize := 32
			oColumn:WidthAutoResize := .T.
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
822
Does your control support subscript or superscript, in HTML captions

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1,oColumn2
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .F.
		oGrid:HeaderHeight := 28
		oGrid:DefaultItemHeight := 24
		oColumns := oGrid:Columns()
			oColumn := oColumns:Add("Column 1")
				oColumn:HTMLCaption := "Column <b><off 2><font ;6>1"
				oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
			oColumn1 := oColumns:Add("Column 2")
				oColumn1:HTMLCaption := "Column <b><off 2><font ;6>2"
				oColumn1:SetProperty("Def",17/*exCellValueFormat*/,1)
			oColumn2 := oColumns:Add("Column 3")
				oColumn2:HTMLCaption := "Column <b><off 2><font ;6>3"
				oColumn2:SetProperty("Def",17/*exCellValueFormat*/,1)
		oItems := oGrid:Items()
			h := oItems:AddItem("Item <font ;6><off 4>1")
			oItems:SetProperty("CellValue",h,1,"Item <font ;6><off -6>2")
			oItems:SetProperty("CellValue",h,2,"Item <b><font ;6><off -6>2<off 4>3<off 4>1")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
821
How can I specify the splited cell's background color

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h,var_SplitCell

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:MarkSearchColumn := .F.
		oGrid:TreeColumnIndex := -1
		oGrid:Columns():Add("1"):SetProperty("Def",4/*exCellBackColor*/,255)
		oColumn := oGrid:Columns():Add("2")
			oColumn:Width := 32
			oColumn:AllowSizing := .F.
		oItems := oGrid:Items()
			h := oItems:AddItem("The Item's background color inherits the Column.Def(exCellBackColor)")
			oItems:SetProperty("ItemDivider",h,0)
			h := oItems:AddItem("The Item's background color inherits the CellBackColor()")
			oItems:SetProperty("ItemDivider",h,0)
			oItems:SetProperty("CellBackColor",h,AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
			h := oItems:AddItem("The Item's background color inherits the CellBackColor(), while the split inherits from the Column.Def(exCellBackColor) ")
			oItems:SetProperty("ItemDivider",h,0)
			oItems:SetProperty("CellBackColor",h,AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
			var_SplitCell := oItems:SplitCell(h,0)
			h := oItems:AddItem("The Item's background color inherits the CellBackColor()")
			oItems:SetProperty("ItemDivider",h,0)
			oItems:SetProperty("CellBackColor",h,AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
			oItems:SetProperty("CellBackColor",0,oItems:SplitCell(h,0),AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,255 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
820
How can I specify a fixed width for a column

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:MarkSearchColumn := .F.
		oGrid:TreeColumnIndex := -1
		oGrid:ColumnAutoResize := .F.
		oColumn := oGrid:Columns():Add("C1")
			oColumn:Width := 17
			oColumn:AllowSizing := .F.
		oColumn1 := oGrid:Columns():Add("C2")
			oColumn1:Width := 17
			oColumn1:AllowSizing := .F.
		oGrid:Columns():Add("Other")
		oGrid:ColumnAutoResize := .T.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
819
How can I split a cell in three parts

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:DrawGridLines := -1/*exAllLines*/
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			h := oItems:AddItem("entire")
			h := oItems:AddItem("split 1")
			h := oItems:SplitCell(h,0)
			oItems:SetProperty("CellValue",0,h,"split 2")
			h := oItems:SplitCell(0,h)
			oItems:SetProperty("CellValue",0,h,"split 3")
			h := oItems:AddItem("entire")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
818
How can I find if there is any filter applied to the control

PROCEDURE OnFilterChange(oGrid)
	DevOut( "If negative, the filter is present, else not" )
	DevOut( Transform(oGrid:Items:VisibleItemCount(),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:FilterChange := {|| OnFilterChange(oGrid)} /*Occurs when filter was changed.*/

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oGrid:TreeColumnIndex := -1
		oGrid:FilterInclude := 4/*exMatchingItemsOnly*/
		oColumn := oGrid:Columns():Add("Column")
			oColumn:DisplayFilterButton := .T.
			oColumn:FilterType := 240/*exFilter*/
			oColumn:Filter := "C1"
		oItems := oGrid:Items()
			h := oItems:AddItem("R1")
			oItems:InsertItem(h,,"C1")
			oItems:InsertItem(h,,"C2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("R2")
			oItems:InsertItem(h,,"C1")
			oItems:InsertItem(h,,"C2")
		oGrid:ApplyFilter()
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
817
How can I prevent showing the lines for the hierarchy while using the exMatchingItemsOnly option

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oGrid:TreeColumnIndex := -1
		oGrid:FilterInclude := 4/*exMatchingItemsOnly*/
		oColumn := oGrid:Columns():Add("Column")
			oColumn:DisplayFilterButton := .T.
			oColumn:FilterType := 240/*exFilter*/
			oColumn:Filter := "C1|C2"
		oItems := oGrid:Items()
			h := oItems:AddItem("R1")
			oItems:InsertItem(h,,"C1")
			oItems:InsertItem(h,,"C2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("R2")
			oItems:InsertItem(h,,"C1")
			oItems:InsertItem(h,,"C2")
		oGrid:ApplyFilter()
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
816
Is there any method to get only the matched items and not the items with his parent

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oGrid:FilterInclude := 4/*exMatchingItemsOnly*/
		oColumn := oGrid:Columns():Add("Column")
			oColumn:DisplayFilterButton := .T.
			oColumn:FilterType := 240/*exFilter*/
			oColumn:Filter := "C1|C2"
		oItems := oGrid:Items()
			h := oItems:AddItem("R1")
			oItems:InsertItem(h,,"C1")
			oItems:InsertItem(h,,"C2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("R2")
			oItems:InsertItem(h,,"C1")
			oItems:InsertItem(h,,"C2")
		oGrid:ApplyFilter()
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
815
Is there any property I can save and restore automatically the current setting, column position, size, and so on (2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:Columns():Add("Column")
		oItems := oGrid:Items()
			oItems:AddItem("Item 1")
			oItems:AddItem("Item 2")
			oItems:AddItem("Item 3")
		oGrid:Layout := "Select=" + CHR(34) + "0" + CHR(34) + ";SingleSort=" + CHR(34) + "C0:2" + CHR(34) + ";Columns=1"
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
814
Is there any property I can save and restore automatically the current setting, column position, size, and so on (1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:Columns():Add("Column")
		oItems := oGrid:Items()
			oItems:AddItem("Item 1")
			oItems:AddItem("Item 2")
			oItems:AddItem("Item 3")
		oGrid:Layout := "gBjAAwAAuABmABpABsAB0ABlAByhoAPIAOEPAA9gYABoABQAgUEg0XN4AOcJicKkpujMbjsfkMFk0YhkQgUOjUEl8gjcGO0ok8KMULjEaGMcj08kQAO8oMkTNEtGwAGQAqc7gUlhh1ABtAEsk9GpEfhElgVcsMupNlnlonlaAFcr0shUsp8QPEtnVJqJhmcIhUMh0QiU5sYAqMngUSuEMw07k8Qv0SgVRrNEuVflF2jF5x9JyNEm0TjQijemyE0jE3t+YruauoAu4Az1qj9BzRn0UzksSnAA0xDjY6qnAw8OiUQ0dwzN0zWz2t7j8/xURAGNvWH6k8xlEhklhEI0O/6QAgI="
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
813
I have noticed that the column's header is changed once the cursor hovers it. Is it possible to change that visual appearance

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oColumns := oGrid:Columns()
			oColumns:Add("Column 1")
			oColumns:Add("Column 2")
		oGrid:SetProperty("BackColorHeader",0x1000000)
		oGrid:SetProperty("Background",32/*exCursorHoverColumn*/,0x12d86ff)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
812
Is it possible to change the visual appearance of the columns selector/floating bar(3)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .F.
		oColumns := oGrid:Columns()
			oColumns:Add("Column 1")
			oColumns:Add("Column 2"):Visible := .F.
		oGrid:VisualAppearance():Add(2,"c:\exontrol\images\normal.ebn")
		oGrid:VisualAppearance():Add(3,"c:\exontrol\images\pushed.ebn")
		oGrid:SetProperty("Background",92/*exColumnsFloatAppearance*/,0x2000000)
		oGrid:SetProperty("Background",87/*exColumnsFloatBackColor*/,0x3000000)
		oGrid:SetProperty("Background",93/*exColumnsFloatCaptionBackColor*/,AutomationTranslateColor( GraMakeRGBColor  ( { 246,245,240 } )  , .F. ))
		oGrid:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
811
Is it possible to change the visual appearance of the columns selector/floating bar(2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .F.
		oColumns := oGrid:Columns()
			oColumns:Add("Column 1")
			oColumns:Add("Column 2"):Visible := .F.
		oGrid:VisualAppearance():Add(3,"c:\exontrol\images\pushed.ebn")
		oGrid:SetProperty("Background",87/*exColumnsFloatBackColor*/,0x3000000)
		oGrid:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
810
Is it possible to change the visual appearance of the columns selector/floating bar(1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:VisualAppearance():Add(2,"c:\exontrol\images\normal.ebn")
		oGrid:SetProperty("Background",92/*exColumnsFloatAppearance*/,0x2000000)
		oGrid:SetProperty("Background",87/*exColumnsFloatBackColor*/,AutomationTranslateColor( GraMakeRGBColor  ( { 246,245,240 } )  , .F. ))
		oGrid:SetProperty("Background",93/*exColumnsFloatCaptionBackColor*/,AutomationTranslateColor( GraMakeRGBColor  ( { 246,245,240 } )  , .F. ))
		oGrid:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
809
I am using the ColumnsFloatBarVisible property on True, but still not able to add any column on that list

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .F.
		oColumns := oGrid:Columns()
			oColumns:Add("Column 1")
			oColumns:Add("Column 2"):Visible := .F.
		oGrid:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
808
Is it possible to list a column to columns selector/floating bar, but still user can use it

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .F.
		oColumns := oGrid:Columns()
			oColumns:Add("Column 1")
			oColumns:Add("Column 2"):Visible := .F.
			oColumn := oColumns:Add("Column 3")
				oColumn:Visible := .F.
				oColumn:Enabled := .F.
		oGrid:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
807
How can I prevent a specific column not to be listed in the columns selector/floating bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .F.
		oColumns := oGrid:Columns()
			oColumns:Add("Column 1")
			oColumns:Add("Column 2"):Visible := .F.
			oColumn := oColumns:Add("Column 3")
				oColumn:Visible := .F.
				oColumn:AllowDragging := .F.
		oGrid:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
806
Is it possible to change the "Columns" caption being shown in the columns selector/floating bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .F.
		oColumns := oGrid:Columns()
			oColumns:Add("Column 1")
			oColumns:Add("Column 2"):Visible := .F.
		oGrid:SetProperty("Description",26/*exColumnsFloatBar*/,"Hidden Columns")
		oGrid:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
805
How can I show the columns selector, so the user can drag and drop columns to the view

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .F.
		oColumns := oGrid:Columns()
			oColumns:Add("Column 1")
			oColumns:Add("Column 2"):Visible := .F.
		oGrid:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
804
The column's header is changed while the cursor hovers it. Is it possible to prevent that

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oColumns := oGrid:Columns()
			oColumns:Add("Column 1")
			oColumns:Add("Column 2")
		oGrid:SetProperty("Background",32/*exCursorHoverColumn*/,-1)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
803
I noticed that when grouping on a field, its details are always expanded. Is it possible to show collapsed by default (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(1):SortOrder := 1/*SortAscending*/
		oGrid:EndUpdate()
		oGrid:BeginUpdate()
		oGrid:EnsureVisibleColumn(0)
		oGrid:Items():SetProperty("ExpandItem",0,.F.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
802
I noticed that when grouping on a field, its details are always expanded. Is it possible to show collapsed by default (method 1)

PROCEDURE OnAddGroupItem(oGrid,Item)
	oGrid:Items():SetProperty("ExpandItem",Item,.F.)
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AddGroupItem := {|Item| OnAddGroupItem(oGrid,Item)} /*Occurs after a new Group Item has been inserted to Items collection.*/

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(1):SortOrder := 1/*SortAscending*/
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
801
Is there a possibility to expand / collapse all groups (or group by group) at runtime with a method (equivalent to pressing the + or - button in the group header)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(1):SortOrder := 1/*SortAscending*/
		oGrid:EndUpdate()
		oGrid:EnsureVisibleColumn(0)
		oGrid:BeginUpdate()
		oItems := oGrid:Items()
			oItems:SetProperty("ExpandItem",oItems:RootItem(0),.F.)
			oItems:SetProperty("ExpandItem",oItems:RootItem(1),.F.)
			oItems:SetProperty("ExpandItem",oItems:RootItem(2),.F.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN